﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PersonWithEvent
{
    class TestPerson
    {
        static void person_PropertyChanged(Object sender, PropertyChangedEventArgs eventArgs)
        {
            Console.WriteLine("The {0} propery was changed from {1} to {2}", eventArgs.Property, eventArgs.OldValue, eventArgs.NewValue);
        }

        static void Main()
        {
            Person person = new Person("Ivan", "Petrov", 23, new DateTime(1987, 5, 31));
            person.PropertyChanged += new PropertyChangedEventHandler(person_PropertyChanged);
            person.FirstName = "Petyr";
            person.LastName = "Ivanov";
            person.Age = 32;
            person.BirthDate = new DateTime(1988, 11, 11);
        }
    }
}